<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Spring Boot 与 Maven 深度整合：构建高效微服务项目</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        .code-block {
            background: #1e1e1e;
            color: #d4d4d4;
            border-radius: 8px;
            overflow-x: auto;
        }
        .code-block pre {
            margin: 0;
            padding: 1.5rem;
            font-family: 'Consolas', 'Monaco', monospace;
            font-size: 14px;
            line-height: 1.6;
        }
        .section-title {
            position: relative;
            padding-left: 20px;
        }
        .section-title::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 24px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 2px;
        }
        .drop-cap {
            float: left;
            font-size: 4rem;
            line-height: 1;
            font-weight: 700;
            margin-right: 0.5rem;
            margin-top: -0.2rem;
            color: #667eea;
            font-family: 'Noto Serif SC', serif;
        }
        .feature-icon {
            width: 60px;
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            font-size: 24px;
            margin-bottom: 1rem;
        }
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
        .highlight-box {
            background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
            border-left: 4px solid #667eea;
            padding: 1.5rem;
            border-radius: 8px;
            margin: 1.5rem 0;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20">
        <div class="container mx-auto px-6">
            <div class="max-w-4xl mx-auto text-center">
                <h1 class="text-5xl md:text-6xl font-bold mb-6 leading-tight">
                    Spring Boot 与 Maven 深度整合
                </h1>
                <p class="text-xl md:text-2xl mb-8 opacity-90">
                    构建高效、可维护的微服务项目
                </p>
                <div class="flex justify-center space-x-6 text-sm">
                    <div class="flex items-center">
                        <i class="fas fa-rocket mr-2"></i>
                        <span>快速启动</span>
                    </div>
                    <div class="flex items-center">
                        <i class="fas fa-cog mr-2"></i>
                        <span>自动配置</span>
                    </div>
                    <div class="flex items-center">
                        <i class="fas fa-cloud mr-2"></i>
                        <span>微服务友好</span>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Introduction -->
    <section class="py-16 bg-white">
        <div class="container mx-auto px-6">
            <div class="max-w-4xl mx-auto">
                <p class="text-lg leading-relaxed text-gray-700">
                    <span class="drop-cap">在</span>现代 Java 生态中，Spring Boot 和 Maven 是两个不可或缺的工具。Spring Boot 以其"约定优于配置"的理念，极大地简化了 Spring 应用的开发；而 Maven 作为最流行的构建工具，提供了强大的依赖管理和项目构建能力。将两者深度整合，可以构建出高效、可维护的微服务项目。
                </p>
            </div>
        </div>
    </section>

    <!-- Why Choose Section -->
    <section class="py-16 bg-gray-50">
        <div class="container mx-auto px-6">
            <div class="max-w-6xl mx-auto">
                <h2 class="text-3xl font-bold mb-12 text-center text-gray-800">
                    <i class="fas fa-question-circle text-purple-600 mr-3"></i>
                    为什么选择 Maven 和 Spring Boot？
                </h2>
                
                <div class="grid md:grid-cols-2 gap-8">
                    <!-- Spring Boot Card -->
                    <div class="bg-white rounded-xl shadow-lg p-8 card-hover">
                        <div class="feature-icon">
                            <i class="fas fa-leaf"></i>
                        </div>
                        <h3 class="text-2xl font-bold mb-4 text-gray-800">Spring Boot 的优势</h3>
                        <ul class="space-y-3">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                                <div>
                                    <strong class="text-gray-700">快速启动：</strong>
                                    <span class="text-gray-600">Spring Boot 提供了内嵌的 Tomcat、Jetty 等服务器，无需额外配置即可运行应用。</span>
                                </div>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                                <div>
                                    <strong class="text-gray-700">自动配置：</strong>
                                    <span class="text-gray-600">通过条件化配置，Spring Boot 可以根据项目的依赖自动配置 Bean。</span>
                                </div>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                                <div>
                                    <strong class="text-gray-700">微服务友好：</strong>
                                    <span class="text-gray-600">Spring Boot 与 Spring Cloud 无缝集成，支持服务发现、负载均衡、配置中心等微服务特性。</span>
                                </div>
                            </li>
                        </ul>
                    </div>

                    <!-- Maven Card -->
                    <div class="bg-white rounded-xl shadow-lg p-8 card-hover">
                        <div class="feature-icon">
                            <i class="fas fa-cube"></i>
                        </div>
                        <h3 class="text-2xl font-bold mb-4 text-gray-800">Maven 的优势</h3>
                        <ul class="space-y-3">
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                                <div>
                                    <strong class="text-gray-700">依赖管理：</strong>
                                    <span class="text-gray-600">Maven 提供了强大的依赖管理功能，能够自动解决依赖冲突。</span>
                                </div>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                                <div>
                                    <strong class="text-gray-700">构建生命周期：</strong>
                                    <span class="text-gray-600">Maven 定义了清晰的构建生命周期（如 <code class="bg-gray-100 px-2 py-1 rounded text-sm">compile</code>、<code class="bg-gray-100 px-2 py-1 rounded text-sm">test</code>、<code class="bg-gray-100 px-2 py-1 rounded text-sm">package</code> 等），便于项目构建。</span>
                                </div>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                                <div>
                                    <strong class="text-gray-700">插件扩展：</strong>
                                    <span class="text-gray-600">Maven 支持丰富的插件，可以扩展构建功能（如代码生成、静态分析、部署等）。</span>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>

                <div class="highlight-box mt-8">
                    <p class="text-gray-700">
                        <i class="fas fa-lightbulb text-yellow-500 mr-2"></i>
                        将两者结合，可以充分发挥各自的优势，构建出高效、可维护的微服务项目。
                    </p>
                </div>
            </div>
        </div>
    </section>

    <!-- Basic Integration Section -->
    <section class="py-16 bg-white">
        <div class="container mx-auto px-6">
            <div class="max-w-6xl mx-auto">
                <h2 class="text-3xl font-bold mb-12 section-title text-gray-800">
                    Maven 与 Spring Boot 的基本整合
                </h2>

                <div class="space-y-8">
                    <div>
                        <h3 class="text-xl font-semibold mb-4 text-gray-700">
                            <i class="fas fa-plus-circle text-purple-600 mr-2"></i>
                            创建 Spring Boot 项目
                        </h3>
                        <p class="text-gray-600 mb-4">
                            Spring Boot 提供了多种创建项目的方式，推荐使用 <a href="https://start.spring.io/" target="_blank" class="text-purple-600 hover:text-purple-800 underline">Spring Initializr</a> 生成项目骨架。生成的项目默认包含 Maven 的 <code class="bg-gray-100 px-2 py-1 rounded text-sm">pom.xml</code> 文件。
                        </p>
                    </div>

                    <div>
                        <h3 class="text-xl font-semibold mb-4 text-gray-700">
                            <i class="fas fa-file-code text-purple-600 mr-2"></i>
                            pom.xml 的基本配置
                        </h3>
                        <p class="text-gray-600 mb-4">
                            Spring Boot 项目的 <code class="bg-gray-100 px-2 py-1 rounded text-sm">pom.xml</code> 通常包含以下关键配置：
                        </p>
                        <div class="code-block">
                            <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
         http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.ts&lt;/groupId&gt;
    &lt;artifactId&gt;ts-microservice&lt;/artifactId&gt;
    &lt;version&gt;1.0.0&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
    
    &lt;parent&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
        &lt;version&gt;2.7.0&lt;/version&gt;
        &lt;relativePath/&gt;
    &lt;/parent&gt;
    
    &lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
        &lt;/dependency&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
            &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
            &lt;scope&gt;test&lt;/scope&gt